﻿<%@ Page Title="" Language="C#" MasterPageFile="~/virtualWeb/user/loginMaster.Master"
    AutoEventWireup="true" CodeBehind="new_register.aspx.cs" Inherits="huaguwang.virtualWeb.user.new_register" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HEAD" runat="server">
    <link href="/CSS/css_register.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="BODY" runat="server">
    <div id="red_septal_red">
        <img src="/images/login_register/new_register_menu1.gif" /></div>

    <script type="text/javascript">
        var imgA = 0;
        $(function() {
            $("#spanRef").click(function() {
                imgA++;
                $("#verifycode").attr("src", "/public/CreateValidate.aspx?stype=img&name=mLogin&r=" + imgA);
            });
            $("#sub_reg").click(function() {
                var name = $.trim($("#txtID").attr("value")).replace(" ", ""); //取出空格
                var m1 = $.trim($("#txtP1").attr("value")).replace(" ", ""); //取出空格，请注意空格替换一定不可以去除
                var m2 = $.trim($("#txtP2").attr("value"));
                if (name.length <= 0) {
                    alert("请输入需要注册的会员名");
                    $("#txtID").focus();
                    return false;
                }

                if (m1.length <= 0) {
                    alert("请输入您的登录密码");
                    $("#txtP1").focus();
                    return false;
                }

                if (m1 != m2) {
                    alert("您输入的登录密码和确认密码不一致");
                    $("#txtP1").focus();
                    return false;
                }

                var sss = $.getJSON("/public/CreateValidate.aspx?stype=code&name=mLogin&r=", function(json) {
                    var v = json["Msg"].toLowerCase();
                    var txtV = $("#txtYZ").attr("value").toLowerCase();
                    if (v != txtV) {
                        alert("验证码不正确");
                    } else {
                        $.getJSON("/user/userfunction.aspx?stype=1", { p1: name, p2: m1 }, function(json) {
                            if (json.success == "False") {
                                alert(json.Msg);
                            } else {
                                location.replace("new_register_callback.aspx?msg=" + json.Msg);
                            }
                        });
                    }
                });
            });
        });
    </script>

    <div id="content_left">
        <div id="input_content">
            <div class="out">
                会员名：<input type="text" class="input_txt" id="txtID" /></div>
            <div class="out">
                登录密码：<input type="password" class="input_txt" id="txtP1" /></div>
            <div class="out">
                确认密码：<input type="password" class="input_txt" id="txtP2" /></div>
            <div class="out">
                <div style="float: left; width: 165px;">
                    验证码：<input type="text" class="input_txt" id="txtYZ" /></div>
                <div id="check_img">
                    <img id="verifycode" src="/public/CreateValidate.aspx?stype=img&name=mLogin" /></div>
            </div>
        </div>
        <div id="not_clear">
            看不清楚？ <font color="#3366cc" id="spanRef" style="cursor: pointer">换一张</font>
        </div>
        <div id="btn_postion">
            <input type="button" class="btn_register" id="sub_reg" />
            <div id="pact">
                <a href=""><font color="#3366cc">《华股网服务条款》</font></a></div>
        </div>
        <div id="content_right">
            <img src="/images/login_register/new_register_AD.gif" />
        </div>
    </div>
</asp:Content>
